<?php
    echo "<html>";  // you could also include DOCTYPE declarations here for all your docs.
    echo "<head><title>Updated to SVN Version</title>";
    //echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"mystyle.css\">";    //link the CSS stylesheet
    //echo "<script language=\"JavaScript\" src=\"javascript/myjs.js\"></script>";  //get the JS in
    echo "</head>";
    echo "UpdateToSVNRevision.php v1.0<br>";
	$SERVER_NAME = $_SERVER["SERVER_NAME"];
	$IP = gethostbyname ($SERVER_NAME);
	$server = gethostbyaddr($IP);
	echo "<br>Server IP: $IP";
	echo "<br>Server Name: $server";
	echo "<br><br>Running as: ";
	passthru("/usr/bin/whoami", $retval);
	echo "<br>Running where: ";
	passthru("pwd", $retval);
	echo "<br><br>";

	//echo "Current dir: ";
	//passthru("pwd", $retval);
	//echo "<br><br>";

	if ($_POST) {
		echo "Deploying by SVN Revision: " . $_POST["rev"] . "<br><br>";

		echo "Executing shell script now ... ";

		passthru("./updatefromsvn.sh " . $_POST["rev"], $retval);

		echo "<br>... Update by Revision Completed!<p>";

		echo "Current dir: ";
		passthru("pwd", $retval);
		echo "<br><br>";
	
	}
	else {
  		echo "Go BACK in your browser to deploy code ... no REVISION supplied!!<br/><br/>";
  		echo "QUERY:" . $_SERVER['QUERY_STRING'];
	}

	//phpinfo();





?>
